<?php

namespace App\Console;

use App\Console\Commands\InformationCommand;
use App\Console\Commands\MyStockFundCommand;
use App\Console\Commands\StockFundCommand;
use App\Console\Commands\StockPeCommand;
use App\Console\Commands\SwooleCommand;
use App\Console\Commands\YbsArticleCommand;
use Carbon\Carbon;
use Illuminate\Console\Scheduling\Schedule;
use Laravel\Lumen\Console\Kernel as ConsoleKernel;

class Kernel extends ConsoleKernel
{
    /**
     * The Artisan commands provided by your application.
     *
     * @var array
     */
    protected $commands = [
        //
        SwooleCommand::class,
        YbsArticleCommand::class,
        InformationCommand::class,
        StockPeCommand::class,
        StockFundCommand::class,
        MyStockFundCommand::class,
    ];

    /**
     * Define the application's command schedule.
     *
     * @param  \Illuminate\Console\Scheduling\Schedule  $schedule
     * @return void
     */
    protected function schedule(Schedule $schedule)
    {
        //
        // 研报社文章
        $schedule->command('command:ybsarticle')
            ->description(Carbon::now()->toDateTimeString() . '研报社数据!')
            ->everyFiveMinutes()
            ->withoutOverlapping();

        $schedule->command('command:information')
            ->description(Carbon::now()->toDateTimeString() . '网络文章数据!')
            ->everyFifteenMinutes()
            ->withoutOverlapping();

        $schedule->command('command:my_stock_fund')
            ->description(Carbon::now()->toDateTimeString() . '资金数据!')
            ->everyMinute()
            ->withoutOverlapping();

        $schedule->command('command:stock_fund')
            ->description(Carbon::now()->toDateTimeString() . 'masket资金数据!')
            ->everyMinute()
            ->withoutOverlapping();

        $schedule->command('command:stockpea')
            ->description(Carbon::now()->toDateTimeString() . 'pe/pb/dv数据!')
            ->dailyAt('18:01')
            ->withoutOverlapping();
    }
}
